package com.mvc.user.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mvc.annotation.ActionMapping;
import com.mvc.common.MvcActionController;
import com.mvc.common.service.CommonServiceImpl;
import com.mvc.common.service.CommonServiceProxy;
import com.mvc.common.service.IUserService;
import com.mvc.model.ActionView;


public class UserActionController extends MvcActionController {
	
	@ActionMapping("/user/getUser.go")
	public ActionView getUser(HttpServletRequest request, HttpServletResponse response) {
		String name = request.getParameter("username");
		
		IUserService loginService = (IUserService)CommonServiceProxy.getCommonServiceFactory(CommonServiceImpl.class);
		String str = loginService.getUser(name);
		
		ActionView actionView = new ActionView("success.form");
		actionView.addObject("name", name + " from user success! " + str);
		return actionView;
	}
}
